<?php

class user_balanceModel extends Model {
	public function getList($where, $value, $page, $pageSize) {
		$limit = ($page - 1) * $pageSize;
		$resultData = [
			'page' => $page,
			'pageSize' => $pageSize,
			'list' => [],
		];
		if (!$list = $this->order('id desc')->limit($limit, $pageSize)->getAll($where, $value)) {
			return $resultData;
		}
		$list1 = [];
		foreach ($list as $key => $value) {
			$list1[$key]['id'] = intval($value['id']);
			$list1[$key]['uid'] = intval($value['uid']);
			$list1[$key]['type'] = intval($value['type']);
			$list1[$key]['price'] = floatval($value['num']);
			$list1[$key]['sourec'] = $value['sourec'];
			$list1[$key]['remark'] = $value['remark'];
			$list1[$key]['addtime'] = date('Y-m-d', $value['addtime']);
		}
		$resultData['list'] = $list1;
		return $resultData;
	}
}